package cn.dbqn.controller;

import cn.dbqn.entity.Drugout;
import cn.dbqn.service.DrugoutService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DrugoutController {
    @Resource
    DrugoutService drugoutService;

    @RequestMapping("/listypck")
    public String list(Model model){
        List<Drugout> list=drugoutService.findALlYpck();
        model.addAttribute("list",list);
        return "lyear_js_jconfirm";
    }

    @ResponseBody
    @RequestMapping("ypckxx")
    public Object ypckxx(@RequestParam("doutno") Integer doutno){
        Drugout ypckxx=drugoutService.ypckxx(doutno);
        return ypckxx;
    }
}
